<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page
	import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@ page import="org.springframework.context.ApplicationContext"%>
<%@ page import="com.shiplanet.service.CategoryService"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%
	ServletContext sc = this.getServletConfig().getServletContext();
	ApplicationContext ac2 = WebApplicationContextUtils
	.getWebApplicationContext(sc);
	CategoryService categoryService = (CategoryService) ac2
	.getBean("categoryService");
	request.setAttribute("categoryMap",
	categoryService.getCategoryNameMap(false, false));
%>
	
<section class="background-page">
	<div class="row padding-top">

		<tiles:insertAttribute name="adminmenu" />

		<article class="column custom-main-column">

			<div id="top" class="row collapse">
				<div class="column large-12">

					<s:form action="deleteCategory" namespace="/admin" method="post" cssClass="custom ng-pristine ng-valid" theme="simple">

						<div class="row">
							<div
								class="box-shadow background-white more-margin-bottom clearfix card content-padding">
								<div
									class="large-12 clearfix blue-topper heading-padding card-header">
									<h3 class="inverse no-margin-top no-margin-bottom">
										<span class="semi-bold"><em>Category Name</em></span>
									</h3>
								</div>
								<div class="column large-4 small-margin-top">
									<p class="gray italic">All sub categories and posts under the Category will be deleted together:</p>
								</div>

								<div class="column large-8 small-margin-top small-margin-bottom">
									<div class="form-row rp_listing_details_category">
										<label for="rp_listing_options_make">Please select category of
											equipment</label>
										<div class="row category-hybrid">
											<div class="column large-12 category-hybrid-root">
												<div class="form-widget select-list ">
													<s:select id="rp_listing_details_category_rootCategory"
														name="categoryId" list="#request.categoryMap" headerKey="0"
														headerValue="-- Select Equipment Category --"
														theme="simple" cssClass="hidden-field" />

													<div class="custom dropdown">
														<a href="http://www.shiplanet.com/#" class="current">--
															Select Equipment Category -- </a><a
															href="http://www.shiplanet.com/#" class="selector"></a>
														<ul>
															<li class="selected">-- Select Equipment Category --</li>
															<s:iterator value="categoryMap" var="map">
																<li class="">${map.value}</li>
															</s:iterator>
														</ul>
													</div>
												</div>
												<div rel="rp_listing_details_category_rootCategory"
													class="helper required "></div>
											</div>
										</div>
										<div rel="rp_listing_details_category"
											class="helper required "></div>
									</div>
								</div>
							</div>
						</div>

						<div class="row collapse">

							<button class="small right" id="payment-submit" type="submit">
								Delete
							</button>

						</div>

					</s:form>

				</div>
			</div>

		</article>
	</div>
</section>